home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 16735 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  895 b 

  1. Path: zk2nws.zko.dec.com!usenet
  2. From: Alexander Goykhman USG <goykhman@zk3.dec.com>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: const member functions
  5. Date: 10 Apr 1996 17:47:40 GMT
  6. Organization: CTG    
  7. Message-ID: <4kgs7s$vb4@zk2nws.zko.dec.com>
  8. References: <316588E6.7D61@geoplex.com>
  9. NNTP-Posting-Host: odessa.zk3.dec.com
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 1.12I (X11; I; OSF1 T4.0 alpha)
  14. X-URL: news:316588E6.7D61@geoplex.com
  15.  
  16. "Jay B. Perry" <jay@geoplex.com> wrote:
  17.  
  18. >class X 
  19. >{
  20. >public:   //  Public methods
  21.  
  22. >   int value( ) const { return _value; }
  23. >
  24. >private:  //  Private methods
  25. >
  26. >   int& value( ) { return _value; }
  27.  
  28.  
  29.     I don't see how a compiler could possibly 
  30.         distinguish between:
  31.  
  32.         int value() 
  33.  
  34.     and
  35.  
  36.         int& value() 
  37.  
  38.  
  39.     IMO, the above is ambiguous and ought to be
  40.     flagged as such by the compiler.
  41.  
  42.